package com.lancoo.ccas52.service;

import com.lancoo.ccas52.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lancoo.ccas52.pojo.response.Scheme;
import com.lancoo.ccas52.pojo.vo.*;

import java.util.List;

/**
 * <p>
 * 教务获取教学计划,相当于专业版本 服务类
 * </p>
 *
 * @author quin.song
 * @since 2022-12-30
 */
public interface PlanTeachingService extends IService<PlanTeaching> {

    /**
     * 同步教务系统数据
     *
     * @param taskId
     * @param schemeList
     */
    void syncEducational(Integer taskId, List<Scheme> schemeList, String term, List<String> gradeList);

    /**
     * 获取教学计划
     *
     * @param taskId
     * @param collegeId
     * @param type
     * @return
     */
    TeachingPlanCount getPlanTeaching(Integer taskId, String collegeId, Integer type, String gradeId);

    /**
     * 根据教学计划id获取教学计划
     *
     * @param planTeachingIds
     * @return
     */
    List<TeachingPlanDto> getPlanTeachingByIds(List<Long> planTeachingIds);

    /**
     * 批量修改教学计划状态
     *
     * @param taskId
     * @param teachPlanIds
     * @param isEnable
     */
    void updatePlanTeaching(Integer taskId, List<Long> teachPlanIds, Integer isEnable);

    /**
     * 插入教学计划对应课程/环节
     *
     * @param addPlanSegCons
     * @return
     */
    List<PlanTeachingCourseSegment> addPlanSegCou(List<AddPlanSegCon> addPlanSegCons);

    /**
     * 获取没有选择该课程的教学计划
     *
     * @param taskId
     * @param flag
     * @param baseCourseId
     * @return
     */
    List<TeachingPlanDto> getTeachingPlanNoCourse(Integer taskId, Integer flag, String baseCourseId, String collegeId);

    /**
     * 获取课程 的教学计划情况
     *
     * @param courseId
     * @param studyNature
     * @return
     */
    List<CampusPlanTeachingVo> getTeachingPlanByCourse(Long courseId, Integer studyNature, Integer teachingClassType);

    /**
     * 获取环节 的教学计划情况
     *
     * @param segmentId
     * @param studyNature
     * @return
     */
    List<CampusPlanTeachingVo> getTeachingPlanBySegment(Long segmentId, Integer studyNature);

    /**
     * 根据课程/环节id和修读性质获取 教学计划学生
     *
     * @param courseId
     * @param studyNature
     * @return
     */
    List<Student> getStudentNumByCourseAndNature(Integer flag, Long courseId, Integer studyNature, String campusId);

    /**
     * 获取一个开课计划(获取一个开课计划里面课程|环节)的学生
     *
     * @param teachingPlanId
     * @param courseId
     * @param flag           1 课程 2 环节
     * @return
     */
    List<Student> getStudentNumByTeachingPlanId(Long teachingPlanId, Long courseId, Integer flag);

    /**
     * 获取一个教学计划的学生，根据class_id分组
     *
     * @param teachingPlanId
     * @return
     */
    List<StudentGroupClass> getStudentListByPlanId(Long teachingPlanId);

    /**
     * 获取一个课程的学生 分组
     *
     * @param courseId
     * @param studyNature
     * @param campusId
     * @return
     */
    List<StudentGroupClass> getStudentListByCourse(Integer flag, Long courseId, Integer studyNature, String campusId, boolean isDisplaySelected);

    /**
     * 获取一个课程辅修的学生
     *
     * @param courseId
     * @return
     */
    List<Student> getMinorStudentByCourseId(Long courseId);

    /**
     * 生成教学班
     *
     * @param taskId
     * @param courseId
     * @param studyNature
     * @param teachingClassNum
     * @param teachingClassType
     * @param classNum          教学班容量
     * @param flag
     * @param campusId
     * @param campusName
     * @param headPointer       已存在教学班数量
     * @return
     */
    List<TeachingClass> generationTeachingClass(Integer taskId, Long courseId, Integer studyNature, Integer teachingClassNum, Integer teachingClassType, Integer classNum, Integer flag, String campusId, String campusName, Integer headPointer);

    /**
     * 快速平均分配学生生成
     *
     * @param courseId
     * @param studyNature
     * @param flag
     * @param teachingClassIds
     * @return
     */
    Integer generationStudent(Long courseId, Integer studyNature, Integer flag, List<Long> teachingClassIds, String campusId);

    /**
     * 生成教学班容量
     *
     * @param teachingClassIds
     * @param studentNum
     * @return
     */
    Integer generationClassNum(List<Long> teachingClassIds, Integer studentNum);

    /**
     * 设置教学计划-课程考核方式  即修改中间表
     *
     * @param courseSetting
     * @return
     */
    CourseSetting setAssessment(CourseSetting courseSetting);

    /**
     * 设置教学计划-环节考核方式  即修改中间表
     *
     * @param segmentSetting
     * @return
     */
    SegmentSetting setSegmentAssessment(SegmentSetting segmentSetting);

    /**
     * 开课计划导出课程
     *
     * @param taskId
     * @param collegeId
     * @param collegeName
     * @param courseTypeId
     * @param courseType
     * @param courseNature
     * @param studyNature
     * @return
     */
    String courseToExcel(Integer taskId, String collegeId, String collegeName, String courseTypeId, String courseType, Integer courseNature, Integer studyNature);

    String segmentToExcel(Integer taskId, String collegeId, String collegeName, String segmentTypeId, String segmentType);

    /**
     * 导出申请
     *
     * @param taskId
     * @param collegeId
     * @param collegeName
     * @param courseTypeId
     * @param courseType
     * @param courseNature
     * @param studyNature
     * @return
     */
    String courseApplyToExcel(Integer taskId, String collegeId, String collegeName, String courseTypeId, String courseType, Integer courseNature, Integer studyNature, List<Long> courseIds);

    String segmentApplyToExcel(Integer taskId, String collegeId, String collegeName, String segmentTypeId, String segmentType, List<Long> segmentIds);
}
